package com.classic.mafiacards;

import android.content.Context;
import android.content.res.Configuration;
import android.preference.PreferenceManager;
import android.util.Log;

import java.util.Locale;

/**
 * Created by pavilion on 11/22/13.
 */
public class OptionsReader {

    public static void updateLanguage(Context context) {
        Configuration config = new Configuration();
        String chosen_language = PreferenceManager.getDefaultSharedPreferences(context).
                getString("language", "English");
        switch (chosen_language.charAt(0)) {
            case 'E':
                config.locale = new Locale("en");
                break;
            case 'У':
                config.locale = new Locale("uk");
                break;
            case 'Р':
                config.locale = new Locale("ru");
                break;
        }
        context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
    }
}



